package com.ruoyi.stream.framework.core.workDomain;

import com.ruoyi.stream.framework.core.IOTask;
import com.ruoyi.stream.framework.core.IOTaskGroup;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;

import java.io.InputStream;

public class MulticastIOTaskGroup extends IOTaskGroup<MulticastIOTask> {

    private final ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);

    public void broadcast(byte[] data){
        channelGroup.writeAndFlush(data);
    }


    @Override
    protected void addIOTask(MulticastIOTask ioTask) {
        channelGroup.add(ioTask.getChannel());

    }

    @Override
    protected void start() {

    }
}
